import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedstate from 'vuex-persistedstate'
import actions from './actions'
import mutations from './mutations'
import getters from './getters'
import Login from './modules/login'
import Demand from './modules/demand'
import Resume from './modules/resume'
import Arrange from './modules/arrange'
import Inquiries from './modules/inquiries'
import Quoted from './modules/quoted'
import ManHourSelect from './modules/manHourSelect'
import PeopleInfo from './modules/peopleInfo'
import LeaveSelect from './modules/leaveSelect'
import PeopleOut from './modules/peopleout'
import Ectrance from './modules/ectrance'
import AddSubAcc from './modules/addSubAcc'
import Home from './modules/home'
Vue.use(Vuex)
export default new Vuex.Store({
    state: {
        userName: '',
        roleName: '',
        reFiles: {},
        files: {},
        mapData: {},
        mapTempData: {}
    },
    actions,
    mutations,
    getters,
    modules: {
        Login,
        Resume,
        Arrange,
        Inquiries,
        ManHourSelect,
        Quoted,
        PeopleInfo,
        PeopleOut,
        Home,
        Ectrance,
        LeaveSelect,
        Demand,
        AddSubAcc
    },
    plugins: [
      createPersistedstate({
        reducer(val){
          return {
            info: val.info
          }
        }
      })
    ]
})
